--
-- PostgreSQL database dump
--

SET search_path = public, pg_catalog;

--
-- Name: chat_aliases; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_aliases (
    alias_id serial NOT NULL,
    user_id integer NOT NULL,
    user_alias text,
    user_avatar character varying(200)
);


--
-- Name: chat_config; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_config (
    config_name character varying(255) NOT NULL,
    config_value character varying(255)
);


--
-- Name: chat_events; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_events (
    event_id serial NOT NULL,
    user_id_from integer,
    room_id_to integer,
    user_id_to integer,
    event_text text,
    event_date timestamp without time zone
);


--
-- Name: chat_prefs; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_prefs (
    user_id integer NOT NULL,
    user_tagline character varying(255),
    user_login_msg character varying(200),
    user_logout_msg character varying(200),
    user_color character varying(10),
    user_css text,
    user_snippet_pad text,
    user_alias text,
    user_show_avatars smallint DEFAULT 0,
    user_show_smilies smallint DEFAULT 0,
    user_allow_pms smallint DEFAULT 0,
    user_allow_ext_pms smallint DEFAULT 0,
    user_away smallint DEFAULT 0,
    user_away_msg character varying(200),
    user_word_start integer DEFAULT 0,
    user_word_goal integer DEFAULT 0,
    user_word_current integer DEFAULT 0
);


--
-- Name: chat_room_groups; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_room_groups (
    group_id serial NOT NULL,
    group_name character varying(255),
    group_dynamic character varying(3) DEFAULT 'no'
);

--
-- Name: chat_rooms; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_rooms (
    room_id serial NOT NULL,
    room_name character varying(20),
    room_password character varying(20),
    room_limit integer DEFAULT 0,
    mod_group integer DEFAULT 0,
    room_topic text,
    room_group integer,
    room_dynamic boolean
);


--
-- Name: chat_sessions; Type: TABLE; Schema: public; Owner: nathan
--

CREATE TABLE chat_sessions (
    session_id character varying(32) NOT NULL,
    user_id integer,
    username character varying(255),
    room_id integer,
    idle_timer integer,
    server_push smallint,
    moderator smallint,
    avatar_url character varying(255),
    board_avatar_url character varying(255)
);


--
-- Name: config_name_idx; Type: INDEX; Schema: public; Owner: nathan
--

CREATE UNIQUE INDEX config_name_idx ON chat_config USING btree (config_name);


--
-- Name: alias_id_idx; Type: INDEX; Schema: public; Owner: nathan
--

CREATE UNIQUE INDEX alias_id_idx ON chat_aliases USING btree (alias_id);


--
-- Name: chat_aliases_alias_id_seq; Type: SEQUENCE SET; Schema: public; Owner: nathan
--

SELECT pg_catalog.setval ('chat_aliases_alias_id_seq', 1, false);


--
-- Name: chat_events_event_id_seq; Type: SEQUENCE SET; Schema: public; Owner: nathan
--

SELECT pg_catalog.setval ('chat_events_event_id_seq', 10, true);


--
-- Name: chat_room_groups_group_id_seq; Type: SEQUENCE SET; Schema: public; Owner: nathan
--

SELECT pg_catalog.setval ('chat_room_groups_group_id_seq', 1, false);


--
-- Name: chat_room_groups_group_name_seq; Type: SEQUENCE SET; Schema: public; Owner: nathan
--

SELECT pg_catalog.setval ('chat_room_groups_group_name_seq', 1, false);


--
-- Name: chat_rooms_room_id_seq; Type: SEQUENCE SET; Schema: public; Owner: nathan
--

SELECT pg_catalog.setval ('chat_rooms_room_id_seq', 1, false);


